Inside Macintosh: QuickTime

Previous | Chapter Top | Chapter Contents | Next

The Image Description Structure

An image description structure contains information that defines the characteristics of a compressed image or sequence. Data in the image description structure indicates the type of compression that was used, the size of the image when displayed, the resolution at which the image was captured, and so on. One image description structure may be associated with one or more compressed frames.

The ImageDescription data type defines the layout of an image description structure. In addition, an image description structure may contain additional data in extensions and custom color tables. The Image Compression Manager provides functions that allow you to get and set the data in image description structure extensions and custom color tables.

struct ImageDescription {
    long idSize;            /* total size of this structure */
    CodecType cType;        /* compressor creator type */
    long resvd1;            /* reserved--must be set to 0 */
    short resvd2;           /* reserved--must be set to 0 */
    short dataRefIndex;     /* reserved--must be set to 0 */
    short version;          /* version of compressed data */
    short revisionLevel;    /* compressor that created data */
    long vendor;            /* compressor developer that created data */
    CodecQ temporalQuality;     
                            /* degree of temporal compression */
    CodecQ spatialQuality;      
                            /* degree of spatial compression */
    short width;            /* width of source image in pixels */
    short height;           /* height of source image in pixels */
    Fixed hRes;             /* horizontal resolution of source image */
    Fixed vRes;             /* vertical resolution of source image */
    long dataSize;          /* size in bytes of compressed data */
    short frameCount;       /* number of frames in image data */
    Str31 name;             /* name of compression algorithm */
    short depth;            /* pixel depth of source image */
    short clutID;           /* ID number of the color table for image */
};
typedef struct ImageDescription ImageDescription;
typedef ImageDescription *ImageDescriptionPtr, **ImageDescriptionHandle;
idSize
Defines the total size of this image description structure with extra data including color lookup tables and other per sequence data.
cType
Indicates the type of compressor component that created this compressed image data. The value of this field indicates the compression algorithm supported by the component. The Codec data type defines a field in the compressor name list structure that identifies the compression method employed by a given compressor component. Apple Computer's Developer Technical Support group assigns these values so that they remain unique. These values correspond, in turn, to text strings that can identify the compression method to the user. See the description of GetCodecNameList on GetCodecNameList for a list of valid values.
resvd1
Reserved for Apple. This field must be set to 0.
resvd2
Reserved for Apple. This field must be set to 0.
dataRefIndex
Reserved for Apple. This field must be set to 0.
version
Indicates the version of the compressed data. The contents of this field should indicate the version of the compression algorithm that was used to create the compressed data. By examining this field, decompressors that support many versions of an algorithm can determine the proper way to decompress the image.
revisionLevel
Indicates the version of the compressor that created the compressed image. Developers of compressors and decompressors assign these version numbers.
vendor
Identifies the developer of the compressor that created the compressed image.
temporalQuality
Indicates the degree of temporal compression performed on the image data associated with this description. This field is valid only for sequences. See "Compression Quality Constants," for a list of available values.
spatialQuality
Indicates the degree of spatial compression performed on the image data associated with this description. This field is valid for sequences and still images. See "Compression Quality Constants" for a list of available values.
width
Contains the width of the source image, in pixels.
height
Contains the height of the source image, in pixels.
hRes
Contains the horizontal resolution of the source image, in dots per inch.
vRes
Contains the vertical resolution of the source image, in dots per inch.
dataSize
Indicates the size of the compressed image, in bytes. This field is valid only for still images. Set this field to 0 if the size is unknown.
frameCount
Contains the number of frames in the image data associated with this description.
name
Indicates the compression algorithm used to create the compressed data. This algorithm is stored in Pascal string format. It always takes up 32 bytes no matter how long the string is. The 32 bytes consist of 31 bytes plus one length byte. The value of this field should correspond to the compressor type specified by the cType field, as well as to the value of the typeName field in the appropriate compressor name structure returned by the GetCodecNameList function (see "The Compressor Name List Structure" for information on the compressor list name structure; see "Getting Information About Compressor Components," which begins on Getting Information About Compressor Components , for information on the GetCodecNameList function). Applications may use the contents of this field to indicate the type of compression used for the associated image.
depth
Contains the pixel depth specified for the compressed image. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the depth of color images. Values of 34, 36, and 40 indicate 2-bit, 4-bit, and 8-bit grayscale, respectively, for grayscale images.
clutID
Contains the ID of the color table for the compressed image, or other special values. If this field is set to 0, then a custom color table is defined for the compressed image. You can use the GetImageDescriptionCTable function, described on GetImageDescriptionCTable , to retrieve the color table. If this field is set to -1, the image does not use a color table.

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next